package com.maixy.easyexecl;

import com.alibaba.excel.EasyExcel;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

/**
 * @ClassName EasyExcelServiceImpl
 * @Description TODO
 * @Date 2022/8/30 12:15
 * @Author Maixy
 */
@Service
public class EasyExcelServiceImpl implements EasyExcelService{

    @Override
    public String importMemberList(MultipartFile file, Integer id) throws IOException {
        System.out.println(1111);
        System.out.println(id);
        List<ImportLevelElementDto> importLevelElementDtoList = EasyExcel.read(file.getInputStream())
                .head(ImportLevelElementDto.class)
                .sheet()
                .doReadSync();
        System.out.println(Arrays.toString(importLevelElementDtoList.toArray()));
        return "ok";
    }
}
